package com.wyl.niupi.framework.vo;

import io.swagger.v3.oas.annotations.media.Schema;

/**
 * @author 吴宇亮 on 2020/11/25 10:05
 */
public class PageResultVo<Entity> {

    /** 总条数 **/
    private Long totalCount;
    /** 数据 **/
    private Entity items;

    /**
     * @param list 数据
     * @param total 总条数
     */
    public PageResultVo(Entity list, Long total) {
        this.items = list;
        this.totalCount = total;
    }

    public PageResultVo(Entity list, Integer total) {
        this.items = list;
        this.totalCount = total.longValue();
    }

    @Schema(description = "总条数", example = "103", required = true)
    public Long getTotalCount() {
        return totalCount;
    }

    @Schema(description = "数据", required = true)
    public Entity getItems() {
        return items;
    }
}
